home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 November: Tool Chest / Dev.CD Nov 98 TC.toast / Sample Code / Snippets / Development Tools & Languages / AEGestalt / AEGestalt.r < prev    next >
Encoding:
Text File  |  1995-02-12  |  12.2 KB  |  511 lines  |  [TEXT/MPS ]

  1. //     Copyright © 1991 by Apple Computer, Inc.  All rights reserved. 
  2. //     AEGestalt.r file.
  3. //    Kent Sandvik DTS
  4. //    This file contains all the normal MacApp resources, with
  5. //    the exception of the window/view resources which are in the
  6. //    views.rsrc file (in 3.0 'View' format). The "2.0 views.rsrc"
  7. //    file contains the same information in the old format.
  8. //
  9. //    <1>        khs        1.0        First final version
  10.  
  11.  
  12. // INCLUDES 
  13.  
  14. #ifndef __TYPES.R__
  15. #include "Types.r"
  16. #endif
  17.  
  18. #ifndef __SYSTYPES.R__
  19. #include "SysTypes.r"                // needed for version resource
  20. #endif        
  21.  
  22. #ifndef __MacAppTypes__
  23. #include "MacAppTypes.r"
  24. #endif
  25.  
  26. #if qTemplateViews
  27. #ifndef __ViewTypes__
  28. #include "ViewTypes.r"
  29. #endif
  30. #endif
  31.  
  32. #if qDebug
  33. include "Debug.rsrc";
  34. #endif
  35.  
  36. #ifndef __RESOURCECONSTANTS__
  37. #include "ResourceConstants.h"            // common header file for resource IDs
  38. #endif
  39.  
  40.  
  41. // RESOURCES FILES
  42.  
  43. include "MacApp.rsrc";
  44. include "views.rsrc";
  45.  
  46.  
  47. // CODE 
  48.  
  49. #if !qPowerPC
  50. include $$Shell("ObjApp")"AEGestalt" 'CODE';
  51. #endif
  52.  
  53. // CONSTANTS
  54.  
  55. // Finder Information
  56.  
  57. #define kApplicationName                $$Shell("XAppName")
  58.  
  59. resource 'SIZE' (-1) {
  60.     saveScreen,
  61.     acceptSuspendResumeEvents,
  62.     enableOptionSwitch,
  63.     canBackground,
  64.     doesActivateOnFGSwitch,
  65.     backgroundAndForeground,
  66.     dontGetFrontClicks,
  67.     ignoreAppDiedEvents,
  68.     is32BitCompatible,
  69.     isHighLevelEventAware,
  70.     localAndRemoteHLEvents,
  71.     isStationeryAware,                
  72.     reserved,
  73.     reserved,
  74.     reserved,
  75.     reserved,
  76. #if qModelFarCode
  77.     1550 * 1024,
  78.     1500 * 1024,
  79. #elif qDebug
  80.     1500 * 1024,
  81.     1475 * 1024
  82. #else
  83.     1375 * 1024,
  84.     1350 * 1024
  85. #endif
  86. };
  87.  
  88. /*--------------------------------------------------------------------------------
  89.     memory stuff
  90. --------------------------------------------------------------------------------*/
  91. resource 'mem!' (132,
  92. #if qNames
  93.     "Additional Stack Space",
  94. #endif
  95.     purgeable) {
  96.     0,                // Add to object heap size
  97.     0,                // Add to heap increment size
  98.     0,                // Add to temporary reserve
  99.     0,                // Add to permanent reserve
  100.     49152            // Add to stack space
  101. };
  102.  
  103.  
  104.  
  105. /*    Printing to the LaserWriter is the time when the most temporary memory
  106.     is in use.  We need the segments in use at that time */
  107.  
  108. resource 'seg!' (256, purgeable) {
  109.     {
  110.         "GNonRes";
  111.         "GClipboard";
  112.         "GClose";
  113.         "GFile";
  114.         "GOpen";
  115.         "GReadFile";
  116.         "GSelCommand";
  117.         "GFinder";
  118.         "GWriteFile";
  119.         "BBNonRes";
  120.         "BBOpen";
  121.         "GNonRes2";
  122.         "GPrint";
  123.         "GReadResource";
  124.         "TESelCommand";
  125.     }
  126. };
  127.  
  128. #if qPowerPC
  129. #include "CodeFragmentTypes.r"
  130.  
  131. resource 'cfrg' (0, "Configuration Info") {
  132.     {
  133.         kPowerPC,
  134.         kFullLib,
  135.         kNoVersionNum,
  136.         kNoVersionNum,
  137.         0,
  138.         0,
  139.         kIsApp,
  140.         kOnDiskFlat,
  141.         kZeroOffset,
  142.         kWholeFork,
  143.         "AEGestalt"
  144.     }
  145. };
  146. #endif
  147.  
  148.  
  149. // APPLEEVENTS 
  150.  
  151. resource 'aedt' (kGestaltAEEvents) {        // AE Dispatch table resource
  152.     {
  153.     kMacAppClass, kAEGetConfig, cAEProvideGestaltInfo;
  154.     }
  155. };
  156. //    AE Class, AE Message ID, command Number
  157.  
  158.  
  159.  
  160. // VERS
  161.  
  162. // Version for MouseInfo
  163.  
  164. RESOURCE 'vers' (1,
  165. #if qNames
  166.     "Application Version",
  167. #endif
  168.     purgeable) {
  169.     0x01,
  170.     0x00,
  171.     final,
  172.     0x01,
  173.     verUs,
  174.     "1.0",
  175.     "1.0, Application created by MacApp® and Mountain Dew®"
  176. };
  177.  
  178.  
  179.  
  180.  
  181. // ALERTS AND DLOGS 
  182.  
  183. include "Defaults.rsrc" 'ALRT'    (phAboutApp);        // About… window
  184. include "Defaults.rsrc" 'DITL'    (phAboutApp);        // About… contents
  185. include "Defaults.rsrc" 'STR#'    (kDefaultCredits);    // credits
  186.  
  187.  
  188. // ICONs and BUNDLE
  189. // Get the default MacApp® application icon and file reference
  190.  
  191. include "Defaults.rsrc"  'ICN#' (128);
  192.  
  193.  
  194. // CMNUs 
  195.  
  196. include "Defaults.rsrc" 'CMNU' (mApple);            // grab the default Apple/File menus
  197.  
  198. resource 'CMNU' (mFile,
  199. #if qNames
  200. "mFile",
  201. #endif
  202. nonpurgeable) {
  203.     mFile,
  204.     textMenuProc,
  205.     EnablingManagedByMacApp,
  206.     enabled,
  207.     "File",
  208.     {
  209.     "New",                noIcon, "N",    noMark, plain, cNew;
  210.     "Close",            noIcon, "W",    noMark, plain, cClose;
  211.     "-",                noIcon, noKey,    noMark, plain, nocommand;
  212.     "Quit",                noIcon, "Q",    noMark, plain, cQuit
  213.     }
  214. };
  215.  
  216. resource 'CMNU' (mExamine,
  217. #if qNames
  218. "mExamine",
  219. #endif
  220. nonpurgeable) {
  221.     mExamine,
  222.     textMenuProc,
  223.     allEnabled,
  224.     enabled,
  225.     "Examine",
  226.     {
  227.     "Find…",            noIcon, "F",    noMark, plain, cFindAEGestalt;
  228.     "Report…",            noIcon, "R",    noMark, plain, cCreateReport
  229.     }
  230. };
  231.  
  232.  
  233. // MBARs 
  234. // Displayed menus 
  235.  
  236. resource 'MBAR' (kMBarDisplayed,
  237. #if qNames
  238. "Windoid",
  239. #endif
  240.     purgeable) {
  241.     {mApple; mFile; mExamine}
  242. };
  243.  
  244.  
  245. //--------------------------------------------------------------------------------------------------
  246. //     Icons, Bundles and FRefs… Oh my! (don't forget the Signature)
  247. //    It is very important that the Signature is registered here, because
  248. //    we are using it as a way to register the application PPC port, and 
  249. //    otherwise we will get a default name, which will not show up in the
  250. //    PPCBrowse filtering function. I learned this hard lesson 3.23 am
  251. //    and it was even a Saturday morning, sigh!
  252.  
  253. type kSignature as 'STR ';
  254. resource kSignature (0,
  255. #if qNames
  256. "Signature",
  257. #endif
  258.     purgeable) {
  259.     "AEGestalt 3.0b2 ©Apple Computer, Inc. 1991"
  260. };
  261.  
  262. resource 'FREF' (kApplicationID,
  263. #if qNames
  264. "AEGestalt Application",
  265. #endif
  266.     purgeable) {
  267.     'APPL',
  268.     0,
  269.     ""
  270. };
  271.  
  272. resource 'FREF' (kDocumentID,
  273. #if qNames
  274. "AEGestalt Document",
  275. #endif
  276.     purgeable) {
  277.     kFileType,
  278.     1,
  279.     ""
  280. };
  281.  
  282. resource 'FREF' (kStationeryID,
  283. #if qNames
  284. "AEGestalt Stationery",
  285. #endif
  286.     purgeable) {
  287.     kStationery,
  288.     2,
  289.     ""
  290. };
  291.  
  292. resource 'BNDL' (kBundleID,
  293. #if qNames
  294. "AEGestalt",
  295. #endif
  296.     purgeable) {
  297.     kSignature,
  298.     0,
  299.     { /* array TypeArray: 2 elements */
  300.         /* [1] */
  301.         'ICN#',
  302.         { /* array IDArray: 3 elements */
  303.             0, kApplicationID,
  304.             1, kDocumentID,
  305.             2, kStationeryID
  306.         },
  307.         /* [2] */
  308.         'FREF',
  309.         { /* array IDArray: 3 elements */
  310.             0, kApplicationID,
  311.             1, kDocumentID,
  312.             2, kStationeryID
  313.         }
  314.     }
  315. };
  316.  
  317.  
  318.  
  319. // About Dialog resources + Views #################################################################################################################
  320. // a couple of the resources are actually unused, but I left them in because I might need them
  321. // in another project :-)
  322.  
  323.  
  324. include "PICT.rsrc";                    // PICT resource (1002)
  325.  
  326. resource 'STR#' (10006, "Window titles", purgeable) {
  327.     {    /* array StringArray: 1 elements */
  328.         /* [1] */
  329.         "About MouseInfo"
  330.     }
  331. };
  332.  
  333. resource 'STR#' (10005, "Static Text text", purgeable) {
  334.     {    /* array StringArray: 4 elements */
  335.         /* [1] */
  336.         "AEGestalt Sample App",
  337.         /* [2] */
  338.         "Information",
  339.         /* [3] */
  340.         "Version Info",
  341.         /* [4] */
  342.         "AEGestalt is a MacApp 3.0 AppleEvent snippet - create and handle AEs (see Release Notes for info!).\nKent Sandvik/DTS (ALink: KSAND, Net: ksand@apple.com)",
  343.         /* [5] */
  344.         " ",
  345.         /* [6] */
  346.         "Kent & Jeff Sandvik hacking on the next Apple OS"
  347.     }
  348. };
  349.  
  350. resource 'TxSt' (10000, purgeable) {
  351.     tsBold,
  352.     36,
  353.     {    /* array: 3 elements */
  354.         /* [1] */
  355.         0x0,
  356.         /* [2] */
  357.         0x0,
  358.         /* [3] */
  359.         0x0
  360.     },
  361.     "Times"
  362. };
  363.  
  364. resource 'TxSt' (10001, purgeable) {
  365.     tsPlain,
  366.     0,
  367.     {    /* array: 3 elements */
  368.         /* [1] */
  369.         0x0,
  370.         /* [2] */
  371.         0x0,
  372.         /* [3] */
  373.         0x0
  374.     },
  375.     "Chicago"
  376. };
  377.  
  378. resource 'TxSt' (10002, purgeable) {
  379.     tsBold,
  380.     9,
  381.     {    /* array: 3 elements */
  382.         /* [1] */
  383.         0x0,
  384.         /* [2] */
  385.         0x0,
  386.         /* [3] */
  387.         0x0
  388.     },
  389.     "Monaco"
  390. };
  391.  
  392. resource 'TxSt' (10003, purgeable) {
  393.     tsBold,
  394.     9,
  395.     {    /* array: 3 elements */
  396.         /* [1] */
  397.         0xFFFF,
  398.         /* [2] */
  399.         0xFFFF,
  400.         /* [3] */
  401.         0xFFFF
  402.     },
  403.     "Monaco"
  404. };
  405.  
  406. resource 'TxSt' (10004, purgeable) {
  407.     tsBold,
  408.     36,
  409.     {    /* array: 3 elements */
  410.         /* [1] */
  411.         0xE604,
  412.         /* [2] */
  413.         0xFFFF,
  414.         /* [3] */
  415.         0x591C
  416.     },
  417.     "Times"
  418. };
  419.  
  420.  
  421.  
  422.  
  423. resource 'View' (12000, "About Box Window") {MAThreeOh, 
  424.     {
  425.     ViewSignatureAndClassname
  426.         {'wind', 909, "", 'ATBW', enabled, noIdle, {}, MAThreeOh, 
  427.         {45, 45}, {263, 435}, sizeFixed, sizeFixed, notShown, doesntWantToBeTarget, 
  428.         handlesCursor, letsSubViewsHandleCursor, noCursorID, 
  429.         handlesHelp, letsSubViewsHandleHelp, noHelpID, 1, 
  430.         NoDrawingEnvironment {}, 
  431.         AdornerListSignatureAndClassname {NoIdentifier, AdornerList, AdornerElementSize, AdornerElementSizeShift, DynamicArrayAllocationIncrement, {
  432.             AdornFirst, AdornerLocalObject {EraseAdorner}, 
  433.             DrawView, AdornerLocalObject {DrawAdorner}}}, emptyUserArea, 
  434.         Window {noGrowDocProc, noID, goAwayBox, notResizable, doFirstClick, 
  435.             freeOnClosing, disposeOnFree, doesntCloseDocument, dontOpenWithDocument, dontAdaptToScreen, dontStagger, forceOnScreen, 
  436.             center, doesntFloat, doesntHideOnSuspend, generateActivates, filler, 10006, 1}, 7}, 
  437.     ViewSignatureAndClassname
  438.         {'stat', 96, "", 'stat', notEnabled, noIdle, {}, MAThreeOh, 
  439.         {10, 25}, {39, 397}, sizeVariable, sizeVariable, shown, doesntWantToBeTarget, 
  440.         handlesCursor, letsSubViewsHandleCursor, noCursorID, 
  441.         handlesHelp, letsSubViewsHandleHelp, noHelpID, 1, 
  442.         NoDrawingEnvironment {}, 
  443.         NoAdorners {}, emptyUserArea, 
  444.         StaticText {mStaticTextHit, notHilited, notDimmed, sizeable, noInset, 10004, dontPreferOutline, autoWrap, dontEraseFirst, justSystem, 10005, 1}, 
  445.         NoSubviews}, 
  446.     ViewSignatureAndClassname
  447.         {'pict', 156, "TPicture", 'pict', notEnabled, noIdle, {}, MAThreeOh, 
  448.         {50, 8}, {195, 265}, sizeVariable, sizeVariable, shown, doesntWantToBeTarget, 
  449.         handlesCursor, letsSubViewsHandleCursor, noCursorID, 
  450.         handlesHelp, letsSubViewsHandleHelp, noHelpID, 1, 
  451.         NoDrawingEnvironment {}, 
  452.         AdornerListSignatureAndClassname {NoIdentifier, AdornerList, AdornerElementSize, AdornerElementSizeShift, DynamicArrayAllocationIncrement, {
  453.             DrawView, AdornerLocalObject {DrawAdorner}, 
  454.             AdornAfter, AdornerSignatureAndClassname {'comp', "", 'comp', freeOnDeletion, $"0F"}}}, emptyUserArea, 
  455.         Picture {mPictureHit, notHilited, notDimmed, sizeable, noInset, 10001, dontPreferOutline, 1002}, 
  456.         NoSubviews}, 
  457.     ViewSignatureAndClassname
  458.         {'stat', 154, "", 'info', notEnabled, noIdle, {}, MAThreeOh, 
  459.         {50, 287}, {16, 122}, sizeVariable, sizeVariable, shown, doesntWantToBeTarget, 
  460.         handlesCursor, letsSubViewsHandleCursor, noCursorID, 
  461.         handlesHelp, letsSubViewsHandleHelp, noHelpID, 1, 
  462.         NoDrawingEnvironment {}, 
  463.         AdornerListSignatureAndClassname {NoIdentifier, AdornerList, AdornerElementSize, AdornerElementSizeShift, DynamicArrayAllocationIncrement, {
  464.             AdornFirst, AdornerLocalObject {EraseAdorner},
  465.             DrawView, AdornerLocalObject {DrawAdorner}, 
  466.             AdornAfter, AdornerSignatureAndClassname {'comp', "", 'comp', freeOnDeletion, $"8F"}}}, emptyUserArea, 
  467.         StaticText {mStaticTextHit, notHilited, notDimmed, sizeable, noInset, 10002, dontPreferOutline, autoWrap, dontEraseFirst, justSystem, 10005, 2}, 
  468.         NoSubviews}, 
  469.     ViewSignatureAndClassname
  470.         {'stat', 154, "", 'vers', notEnabled, noIdle, {}, MAThreeOh, 
  471.         {200, 287}, {16, 122}, sizeVariable, sizeVariable, shown, doesntWantToBeTarget, 
  472.         handlesCursor, letsSubViewsHandleCursor, noCursorID, 
  473.         handlesHelp, letsSubViewsHandleHelp, noHelpID, 1, 
  474.         NoDrawingEnvironment {}, 
  475.         AdornerListSignatureAndClassname {NoIdentifier, AdornerList, AdornerElementSize, AdornerElementSizeShift, DynamicArrayAllocationIncrement, {
  476.         AdornFirst, AdornerLocalObject {EraseAdorner},
  477.         DrawView, AdornerLocalObject {DrawAdorner}, 
  478.             AdornAfter, AdornerSignatureAndClassname {'comp', "", 'comp', freeOnDeletion, $"8F"}}}, emptyUserArea, 
  479.         StaticText {mStaticTextHit, notHilited, notDimmed, sizeable, noInset, 10002, dontPreferOutline, autoWrap, dontEraseFirst, justSystem, 10005, 3}, 
  480.         NoSubviews}, 
  481.     ViewSignatureAndClassname
  482.         {'stat', 96, "", 'sta1', notEnabled, noIdle, {}, MAThreeOh, 
  483.         {70, 287}, {130, 144}, sizeVariable, sizeVariable, shown, doesntWantToBeTarget, 
  484.         handlesCursor, letsSubViewsHandleCursor, noCursorID, 
  485.         handlesHelp, letsSubViewsHandleHelp, noHelpID, 1, 
  486.         NoDrawingEnvironment {}, 
  487.         NoAdorners {}, emptyUserArea, 
  488.         StaticText {mStaticTextHit, notHilited, notDimmed, sizeable, noInset, 10003, dontPreferOutline, autoWrap, dontEraseFirst, justSystem, 10005, 4}, 
  489.         NoSubviews}, 
  490.     ViewSignatureAndClassname
  491.         {'stat', 96, "", 'sta2', notEnabled, noIdle, {}, MAThreeOh, 
  492.         {225, 287}, {36, 144}, sizeVariable, sizeVariable, shown, doesntWantToBeTarget, 
  493.         handlesCursor, letsSubViewsHandleCursor, noCursorID, 
  494.         handlesHelp, letsSubViewsHandleHelp, noHelpID, 1, 
  495.         NoDrawingEnvironment {}, 
  496.         NoAdorners {}, emptyUserArea, 
  497.         StaticText {mStaticTextHit, notHilited, notDimmed, sizeable, noInset, 10003, dontPreferOutline, autoWrap, dontEraseFirst, justSystem, 10005, 5}, 
  498.         NoSubviews},
  499.     ViewSignatureAndClassname
  500.         {'stat', 96, "", 'sta3', notEnabled, noIdle, {}, MAThreeOh, 
  501.         {248, 8}, {16, 360}, sizeVariable, sizeVariable, shown, doesntWantToBeTarget, 
  502.         handlesCursor, letsSubViewsHandleCursor, noCursorID, 
  503.         handlesHelp, letsSubViewsHandleHelp, noHelpID, 1, 
  504.         NoDrawingEnvironment {}, 
  505.         NoAdorners {}, emptyUserArea, 
  506.         StaticText {mStaticTextHit, notHilited, notDimmed, sizeable, noInset, 10003, dontPreferOutline, autoWrap, dontEraseFirst, justSystem, 10005, 6}, 
  507.         NoSubviews}, 
  508.     }
  509. };
  510.  
  511.